<!-- * 文件名：富文本
* 作者：ZQK
* 描述：〈描述〉
* 修改人：ZQK
* 修改时间：2025-3-15  -->
<template>
  <view class="container">
		<NavigatorBar :title="type"></NavigatorBar>
		<view class="content">
			<rich-text :nodes="htmlText"></rich-text>
		</view>
  </view>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	import { onLoad } from "@dcloudio/uni-app"
	import NavigatorBar from '@/components/navigatorBar/NavigatorBar.vue'
	import Api from '@/api/modules/home.ts'
	
	let type = ref<string>('')
	let htmlText = ref<string>('')
	
	const getDocument = (type: string) => {
		Api.getSystemInfo().then((res: any) => {
			if(type === '用户协议'){
				htmlText.value = res.data.userAgreement
			} else if(type === '隐私政策'){
				htmlText.value = res.data.privacyAgreement
			} else if(type === '合伙人服务协议'){
				htmlText.value = res.data.partnerAgreement
			}
			console.log(htmlText.value)
		})
	}
	
	onLoad((options: any)=>{
		type.value = options.type
		getDocument(options.type)
	})
</script>

<style scoped lang="scss">
.container {
  width: 100%;
  height: 100%;
	background: #5EB847;
	
	.content{
		background: #ffffff;
	}
}
</style>